package top.kuxiao.crmserver.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 销售机会
 * </p>
 *
 * @author xiaozhang
 * @since 2022-01-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SaleChance implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(value = "sc_id", type = IdType.AUTO)
    private Integer scId;

    /**
     * 客户名称
     */
    private String scCustomerName;

    /**
     * 机会来源id->外键
     */
    private Integer oppId;
    @TableField(exist = false)
    private Opportunity opportunity;  // 机会来源

    /**
     * 机会描述
     */
    private String oppDescription;

    /**
     * 联系人
     */
    private String scContact;

    /**
     * 联系电话
     */
    private Long scContactNumber;

    /**
     * 成功几率(%)
     */
    private Integer scPercentageOfSuccess;

    /**
     * 概要
     */
    private String scOutline;

    /**
     * 创建人
     */
    private String scCreator;


    /**
     * 创建时间
     */
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd HH:mm:ss")
    private Date scCreationTime;

    /**
     * 外键(指派给)->客户经理
     */
    private Integer scAssignToId;
    @TableField(exist = false)
    private AccountManager scAssignTo;  // 客户经理

    /**
     * 指派时间
     */
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd HH:mm:ss")
    private Date scAssignTime;

    /**
     * 销售机会的状态->外键
     */
    private Integer oppStateId;
    @TableField(exist = false)
    private OpportunityState opportunityState;  // 销售机会状态


}
